import { defineEventHandler } from 'h3';

export default defineEventHandler(async () => {
  return {
    code: 0,
    data: {
      resourceType: 'room',
      states: ['idle', 'reserved', 'occupied', 'cleaning', 'maintenance'],
      transitions: [
        { from: 'idle', to: 'reserved', by: 'reserve' },
        { from: 'reserved', to: 'idle', by: 'cancel' },
        { from: 'reserved', to: 'occupied', by: 'checkin' },
        { from: 'occupied', to: 'cleaning', by: 'checkout' },
        { from: 'cleaning', to: 'idle', by: 'finishCleaning' },
        { from: 'idle', to: 'maintenance', by: 'startMaintenance' },
        { from: 'maintenance', to: 'idle', by: 'finishMaintenance' },
      ],
    },
    message: '获取状态机定义成功',
  };
});
